package com.scsystem.xysc.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;


import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName admin_user
 */
@TableName(value ="admin_user")
@Data
public class AdminUser implements Serializable {
    /**
     * 唯一标识ID
     */
    @TableId(value = "admin_id", type = IdType.AUTO)
    private Long adminId;

    /**
     * 用户名
     */
    @TableField(value = "admin_name")
    private String adminName;

    /**
     * 密码
     */
    @TableField(value = "admin_password")
    private String adminPassword;

    /**
     * 账号的创建时间
     */
    @TableField(value = "create_time")
//    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")                    // 表示返回时间类型
//    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")      // 表示接收时间类型

    private Date createTime;

    /**
     * 最后一次登录的时间
     */
    @TableField(value = "last_login_time")

    private Date lastLoginTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public String toString() {
        return "AdminUser{" +
                "adminId=" + adminId +
                ", adminName='" + adminName + '\'' +
                ", adminPassword='" + adminPassword + '\'' +
                ", createTime=" + createTime +
                ", lastLoginTime=" + lastLoginTime +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AdminUser adminUser = (AdminUser) o;
        return Objects.equals(getAdminId(), adminUser.getAdminId()) && Objects.equals(getAdminName(), adminUser.getAdminName()) && Objects.equals(getAdminPassword(), adminUser.getAdminPassword()) && Objects.equals(getCreateTime(), adminUser.getCreateTime()) && Objects.equals(getLastLoginTime(), adminUser.getLastLoginTime());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getAdminId(), getAdminName(), getAdminPassword(), getCreateTime(), getLastLoginTime());
    }

}